﻿using hospital_management_system.ServiceReference1;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace hospital_management_system.Controllers
{
    public class DefaultController : Controller
    {

        ServiceReference1.WebService1SoapClient client = new ServiceReference1.WebService1SoapClient();

        //挂号页面
        public ActionResult Index()
        {
            return View();
        }
        [HttpPost]
        public ActionResult Index(FormCollection fm)
        {
           
            ServiceReference1.Gh_Table Gh = new Gh_Table();
            Gh.Gh_Reason = fm["gh_reason"];

            Gh.U_Name = fm["u_name"];
            Gh.Hosp_ID = Convert.ToInt32(fm["txthosp"]);
            Gh.Office_ID = Convert.ToInt32(fm["txtoffice"]);
            Gh.Doctor_ID = Convert.ToInt32(fm["txtdoctor"]);
            Gh.Gh_Time = Convert.ToDateTime( (fm["Gh_Time"].ToString()));
            Gh.Gh_DoctorTypeID = Convert.ToInt32(fm["txtjibie"]); 
             var result = client.GetDataGHinfo(Gh);
            return Json(result);
<<<<<<< .mine
      

||||||| .r31
||||||| .r24
           Gh.U_Name= fm["u_name"];
           Gh.Hosp_ID = Convert.ToInt32(fm["txthosp"]);
          Gh.Office_ID= Convert.ToInt32(fm["txtoffice"]);
           Gh.Doctor_ID = Convert.ToInt32(fm["txtdoctor"]);
          Gh.Gh_Time= Convert.ToInt32( fm["Gh_Time"].ToString());
            var result = client.GetDataGHinfo(Gh);
            return View(result);
=======
           Gh.U_Name= fm["u_name"];
           Gh.Hosp_ID = Convert.ToInt32(fm["txthosp"]);
          Gh.Office_ID= Convert.ToInt32(fm["txtoffice"]);
           Gh.Doctor_ID = Convert.ToInt32(fm["txtdoctor"]);
          Gh.Gh_Time= Convert.ToDateTime( fm["Gh_Time"]);
            Gh.Doctor_TypeID = Convert.ToInt32(fm["GH_type"]);
           
            var result = client.GetDataGHinfo(Gh);
            return View(result);
>>>>>>> .r30
=======
||||||| .r24
           Gh.U_Name= fm["u_name"];
           Gh.Hosp_ID = Convert.ToInt32(fm["txthosp"]);
          Gh.Office_ID= Convert.ToInt32(fm["txtoffice"]);
           Gh.Doctor_ID = Convert.ToInt32(fm["txtdoctor"]);
          Gh.Gh_Time= Convert.ToInt32( fm["Gh_Time"].ToString());
            var result = client.GetDataGHinfo(Gh);
            return View(result);
=======
           Gh.U_Name= fm["u_name"];
           Gh.Hosp_ID = Convert.ToInt32(fm["txthosp"]);
          Gh.Office_ID= Convert.ToInt32(fm["txtoffice"]);
           Gh.Doctor_ID = Convert.ToInt32(fm["txtdoctor"]);
          Gh.Gh_Time= Convert.ToDateTime( fm["Gh_Time"]);
         Gh.Doctor_TypeID = Convert.ToInt32(fm["GH_type"]);
           
            var result = client.GetDataGHinfo(Gh);
            return View(result);
>>>>>>> .r30
>>>>>>> .r32
        }
        [HttpPost]
        //获取医院的下拉列表值
        public ActionResult select1()
        {
            var result = client.GetDataHospital();
            return Json(result);
        }
        [HttpPost]
        //获取科室的下拉列表值
        public ActionResult select2()
        {
            var data = client.GetDataOffice();
            return Json(data);
        }
        [HttpPost]
        //获取医院的下拉列表值
        public ActionResult select3()
        {
            var list = client.GetDataDoctor();
            return Json(list);
        }

        [HttpPost]
        //获取医生的下拉列表值
        public ActionResult select4()
        {
            var list = client.GetDatajibie();
            return Json(list);
        }
<<<<<<< .mine

        //[HttpPost]
        ////获取挂号类型的下拉列表值
        //public ActionResult select4()
        //{
        //    var type = client.GetDataGHtype();
        //    return Json(type);
        //}
||||||| .r31
||||||| .r24
=======
        [HttpPost]
        //获取挂号类型的下拉列表值
        public ActionResult select4()
        {
            var type = client.GetDataGHtype();
            return Json(type);
        }
=======
||||||| .r24
=======
        [HttpPost]
        //获取挂号类型的下拉列表值
        public ActionResult select4()
        {
            var type = client.GetDataGHtype();
            if (type == null)
            { }
            return Json(type);
        }
>>>>>>> .r32
        public ActionResult GHinfoShow()
        {
          var  result = client.GetDataGHrecord();
            return View(result);     
        }



    }
}